package com.xujl.datalibrary.task;

import com.xujl.datalibrary.bean.RequestBean;

/**
 * <pre>
 *     @author : xujl
 *     e-mail : 597355068@qq.com
 *     time   : 2018/11/14
 *     desc   :
 *     version: 1.0
 * </pre>
 */
public class TaskFactory {
    public static TaskInterface createTaskWorker (RequestBean bean) {
        switch (bean.getTaskType()) {
            case TaskType.DB:
                return new TaskDb();
            case TaskType.NETWORK:
                return new TaskNetwork();
            case TaskType.SP:
                return new TaskSp();
            default:
                return new TaskDefault();

        }
    }
}
